#!/bin/bash
DIR=/tmp/searchusers
FINCHKEY=`cat $DIR/1 | jq .data.apiToken | tr -d \"`
SPRUCKEY=`cat $DIR/4 | jq .data.apiToken | tr -d \"`
echo "Search API:"
curl -s "http://localhost:8080/api/search?q=*&key=$FINCHKEY" | jq '.data.fq_actual'
echo "Database:"
scripts/search/dbperms $1 | grep '|'
echo "Solr per group docs (old):"
curl -s "http://localhost:8983/solr/collection1/select?rows=100&wt=json&indent=true&q=entityId%3A$1" | jq '.response.docs[] | {id, name_sort, perms_ss}'
echo "Solr permission docs (new):"
curl -s "http://localhost:8983/solr/collection1/select?rows=100&wt=json&indent=true&q=definition_point_dvobject_id_s%3A$1" | jq '.response.docs[] | {definition_point_s,discoverable_by_ss}'
echo "Java:"
curl -s "http://localhost:8080/api/search/perms?q=*&key=$FINCHKEY&id=$1" | jq '.data[]' 2>/dev/null
exit
echo "Search API perms, items (finch):"
curl -s "http://localhost:8080/api/search?q=*&key=$FINCHKEY" | jq '.data | {fq_actual, items}'
echo "Search API perms, items (spruce):"
curl -s "http://localhost:8080/api/search?q=*&key=$SPRUCKEY" | jq '.data | {fq_actual, items}'
